package org.csu.small.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("small_user")
public class User {
    @TableId(type=IdType.AUTO)
    private Integer id;
    private String username;
    private String password;
    private String email;
    private String phone;
    private Integer role;
    private Double point;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;

    public void hideUserName(){
        int len = this.username.length();
        String hideUserName = this.username.substring(0,len/2) +"***"+ this.username.substring(len/2+1);
        this.username = hideUserName;
    }
}
